import * as tslib_1 from "tslib";
import { Injectable } from '@angular/core';
import { FrameContext } from '@farris/devkit';
import { BeActionService, FormMessageService } from '@farris/command-services';
import { tap } from 'rxjs/operators';
var BXDLBFrmControllerService = /** @class */ (function () {
    function BXDLBFrmControllerService(frameContext, beActionService, messageService) {
        this.frameContext = frameContext;
        this.beActionService = beActionService;
        this.messageService = messageService;
    }
    /**
   * audit
   * @param id 数据id
   * @param flag 稽核标识
   * @remarks
   * @returns
   */
    BXDLBFrmControllerService.prototype.audit = function (id, flag) {
        var _this = this;
        var repository = this.frameContext.repository;
        var requestInfo = repository.restService.buildRequestInfo();
        var actionUri = 'aduitbill';
        //此处actionUri为报销单列表Eapi中稽核动作URI尾部字段
        var body = {
            id: id,
            flag: flag,
            requestInfo: requestInfo
        };
        var action$ = this.beActionService.invokeAction(actionUri, 'PUT', null, null, body);
        return action$.pipe(tap(function (responseInfo) {
            _this.messageService.info("已稽核完成!");
        }));
    };
    BXDLBFrmControllerService = tslib_1.__decorate([
        Injectable(),
        tslib_1.__metadata("design:paramtypes", [FrameContext,
            BeActionService,
            FormMessageService])
    ], BXDLBFrmControllerService);
    return BXDLBFrmControllerService;
}());
export { BXDLBFrmControllerService };
